package com.kakarote.hrm.constant;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

@Getter
public enum OrgSectorEnum {
    ONE(1, "集团总部"),
    TWO(2, "公用事业"),
    THREE(3, "金融投资"),
    FOR(4, "现代农业"),
    FIVE(5, "工程地产"),
    SIX(6, "其他板块");

    private Integer value;
    private String name;

    OrgSectorEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static String getNameByValue(Integer value) {
        for (OrgSectorEnum educationEnum : OrgSectorEnum.values()) {
            if (educationEnum.getValue().equals(value)) {
                return educationEnum.getName();
            }
        }
        return "";
    }


    public static Integer getValueByName(String name) {
        for (OrgSectorEnum educationEnum : OrgSectorEnum.values()) {
            if (educationEnum.getName().equals(name)) {
                return educationEnum.getValue();
            }
        }
        return null;
    }

    public static Map<Integer, String> getOrgSectorEnum() {
        Map<Integer, String> map = new HashMap<>();
        for (OrgSectorEnum educationEnum : OrgSectorEnum.values()) {
            map.put(educationEnum.getValue(), educationEnum.getName());
        }
        return map;
    }
}
